textiter: small optimization for find_by_log_attrs()
authorSébastien Wilmet <swilmet@gnome.org>
Fri, 11 Apr 2014 11:41:50 +0000 (13:41 +0200)
committerSébastien Wilmet <swilmet@gnome.org>
Sun, 13 Jul 2014 15:08:52 +0000 (17:08 +0200)
commit472fd9a75fcaa445e2a7edd63a0d2d412c190417
tree4ed1f8b5e920bf14c806fecbed132b0df6d99a19
parent7f6ae622d374f2a6c5fccaa14e981c1d26cf7b35
textiter: small optimization for find_by_log_attrs()

Use gtk_text_iter_set_line_offset (&tmp_iter, 0) instead of
gtk_text_iter_get_line(). The difference should not be big. In the first
case the line doesn't need to be traversed thanks to the offset 0. For
get_line(), the btree must be traversed.

A temporary iter is needed to not break the behavior. But the behavior
is quite strange, the function works directly on the iter passed as an
argument to the function, even if the function returns FALSE (not
found). So maybe a later commit will fix this strange behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=629129
gtk/gtktextiter.c